﻿using System;
using System.Collections.Generic;

namespace NLite
{
    /// <summary>
    /// 监听管理器接口
    /// </summary>
    /// <typeparam name="TListener">监听器类型</typeparam>
    /// <remarks>观察者模式中的抽象主题角色</remarks>
    public interface IListnerManager<TListener>:IDisposable,IEnumerable<TListener>
        where TListener:IListener
    {
        /// <summary>
        /// 注册监听器
        /// </summary>
        /// <param name="listners">监听器集合</param>
        void Register(params TListener[] listners);
        /// <summary>
        /// 注销监听器
        /// </summary>
        /// <param name="listners">监听器集合</param>
        void UnRegister(params TListener[] listners);

        /// <summary>
        /// 监听器数量
        /// </summary>
        int Count { get; }

        /// <summary>
        /// 
        /// </summary>
        void Clear();
    }

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TListener"></typeparam>
    /// <typeparam name="TEnum"></typeparam>
    public interface IListenerManager<TListener, TEnum> : IDisposable,IEnumerable<TListener>
        where TListener : IListener<TEnum>
    {
        /// <summary>
        /// 注册监听器
        /// </summary>
        /// <param name="listners">监听器集合</param>
        void Register(params TListener[] listners);
        /// <summary>
        /// 注销监听器
        /// </summary>
        /// <param name="listners">监听器集合</param>
        void UnRegister(params TListener[] listners);

        /// <summary>
        /// 监听器数量
        /// </summary>
        int Count { get; }

        /// <summary>
        /// 
        /// </summary>
        void Clear();
    }

  
}